/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution {
public:
    ListNode* deleteNode(ListNode* head, int val) {
    	return recur(head,val);
    }

    ListNode* resur(ListNode* head, int val){
    	if(head = NULL && head->next = NULL) return head;
    	if(head->val == val) head = head->next;
    	if(head->next->val == val) head->next = head->next->next;
    	return head;
    }
};
